uniform vec4 uni_vec4_diffuse;
uniform vec4 uni_vec4_specular;
varying vec3 var_vec3_normal;
varying vec3 var_vec3_tangent;
varying vec3 var_vec3_binormal;
varying vec3 var_vec3_position;

void main(void)
{
   float angle = 15.0;
   vec3 viewVec=vec3(0,0,1);
   vec3 lightDir=vec3(0,0,1);
   vec3 normal=normalize(var_vec3_normal);
   float cosA, sinA;
   sinA = sin(angle);
   cosA = cos(angle);
   vec3 tang=sinA*var_vec3_tangent+cosA*var_vec3_binormal;
   tang=normalize(tang);
   float diff=clamp(dot(lightDir,normal),0.0,1.0);
   float cs=-dot(viewVec,tang);
   float sn=sqrt(1.0 - cs * cs);
   float cl= dot(lightDir,tang);
   float sl=sqrt(1.0 - cl * cl);
   float spec = pow(clamp((cs*cl+sn*sl),0.0,1.0),32.0);
   gl_FragColor=uni_vec4_diffuse*diff+uni_vec4_specular*spec;
    
}